
#include <iostream>
#include "Thread.hpp"
#include <vector>
#include <pthread.h>

using std::cout;
using std::endl;
using namespace zzz;

void testfun(int n)
{
    cout << n << endl;
}
int main()
{
    std::vector<Thread<int>> pths;

    for (int i = 0; i < 5; i++)
    {
        std::string tname = "thread-" + std::to_string(i + 1);

        pths.emplace_back(testfun, 100, tname);
    }
    for (auto &thread : pths)
    {
        thread.start();
    }
    for (auto &thread : pths)
    {
        thread.join();
    }
    cout << "main end" << endl;

    return 0;
}